<!DOCTYPE html>
<html class="no-js">
<head lang="en">

    <#include "../head_import.html" />

</head>
<body>
<#include "../include/top_nav.html">
    <div class="am-cf admin-main">

        <!-- sidebar start -->
        <#include "../adspace/left.html">
            <!-- sidebar end -->
            <!-- content start-->
            <div class="admin-content">
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><@s.m "global.position"/>: 首页海报 - 属性</div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <form class="ropt">
                            <input type="submit" value="返回列表" onclick="this.form.action='list.do';"/>
                        </form>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <form action="o_update.do" method="post" class="am-form">
                            <table width="100%" class="pn-ftable" cellpadding="2" cellspacing="1" border="0">

                                <tr id="cc"><td class="pn-flabel pn-flabel-h"  width="5%">海报图：</td><td  width="95%" class="pn-fcontent"><input type="button" value="增加图片" onclick="addPicLine()"></td></tr>
                                <tr><td class="pn-flabel pn-flabel-h"  width="5%"></td>
                                    <td class="pn-fcontent" id="pictures"  width="95%">
                                        <#if listPoster?size gt 0>
                                            <#list listPoster as poster>
                                                <table id="picTable${poster_index}" border="0" style="float: left;">
                                                    <tr>
                                                        <td>
                                                            <div><input type="text" value="${poster.picUrl!}" id="uploadImgPath${poster_index}" name="picture"
                                                                        style="width: 160px" /> <a href="javascript:void(0);"
                                                                                                   onclick="if(confirm('是否删除')){$('#picTable${poster_index}').remove();delposter('${poster.id}');return true;}else{return false;}" class="pn-opt">删除</a>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="updateCate($('#in${poster_index}').val(),${poster.id});">修改链接</a></div>
                                                            <div><span id="ufc${poster_index}"><input type="file"
                                                                                                      id="uploadFile${poster_index}" size="10" style="width: 150px" /></span> <input
                                                                    type="button" value="上传" onclick="upload(${poster_index});"/></div>
                                                            <div>宽: <input type="text" id="zoomWidth${poster_index}" value="740" size="5"/> 高: <input type="text" id="zoomHeight${poster_index}" value="348" size="5"/> <input type="button" value="<@s.m "imageupload.cut"/>" onclick="imgCut(${poster_index});"/> </div>
                                                            <div><textarea id="in${poster_index}" style="width:200px;height:60px;" name="interUrl1" maxlength="255">${poster.interUrl!}</textarea></div>
                                                        </td>
                                                        <td><img src="${poster.picUrl}" id="preImg{0}" alt="预览" noResize="true" style="overflow:hidden;width:90px;height:90px;background-color:#ccc;border:1px solid #333"/></td>
                                                    </tr>
                                                </table>
                                            </#list>
                                        </#if>
                                        <div id="picBefore" style="clear:both"></div>
                                    </td>
                                </tr>
                            </table>
                            <input type="submit" onclick="return ff()" value="修改">
                        </form>
            </div>
    </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <textarea id="picTable" style="display: none;">
                            <table id="picTable{0}" border="0" class="am-table am-table-striped am-table-hover table-main">
                                <tr>
                                    <td>
                                        <div><input type="text" id="uploadImgPath{0}" name="picUrl"
                                                    style="width: 160px" /> <a href="javascript:void(0);"
                                                                               onclick="$('#picTable{0}').remove();" class="pn-opt">删除</a></div>
                                        <div><span id="ufc{0}"><input type="file"
                                                                      id="uploadFile{0}" size="10" style="width: 150px" /></span> <input
                                                type="button" value="上传" onclick="upload({0});"/></div>
                                        <div>宽: <input type="text" id="zoomWidth0" value="139" size="5"/> 高: <input type="text" id="zoomHeight0" value="139" size="5"/> <input type="button" value="<@s.m "imageupload.cut"/>" onclick="imgCut(0);"/> </div>
                                        <div>&lt;textarea style="width:200px;height:60px;" name="interUrl" maxlength="255"&gt;&lt;/textarea&gt;</div>
                                    </td>
                                    <td><img id="preImg{0}" alt="预览" noResize="true" style="overflow:hidden;width:90px;height:90px;background-color:#ccc;border:1px solid #333"/></td>
                                </tr>
                            </table>
                        </textarea>
                    </div>
                </div>

    </div>

    </div>

<script type="text/javascript">
$(function() {
	$("#baseForm").validate();
});
function addx(){
	var aa = $("#context").html();
	$("#cc").before(aa);
}
function dele(a){
	var b =$(a).parent();
	$(b).parent().remove();
	
}

function delposter(id){
	$.post("o_delPoster.do",{id:id},function(data){
            if(data=='success'){
                  alert('删除成功');
                }
		});
}

function updateCate(val,id){
	$.post("o_updateCare.do",{val:val,id:id},function(data){
        if(data=='success'){
              alert('修改成功');
            }
	});
}
</script>







<#include "/common/image_upload.html"/>


<script type="text/javascript">
var picIndex = 0;
<#if listPoster??>
picIndex = ${listPoster?size};
</#if>
	var picTpl = $.format($("#picTable").val());
	function addPicLine() {
		$('#picBefore').before(picTpl(picIndex++));
	}
	
</script>
    </body>
</html>